package com.paradox.aggregation.provider.config.dataSource;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DataSourceSwitcher {

    public static final ThreadLocal<String> LOOKUP_KEY = new ThreadLocal<String>();

    public static final String READ="read";
    public static final String WRITE="write";

    public static void resetLookupKey(){
        LOOKUP_KEY.remove();
        log.info("重置数据源-->read！");
    }
    public static void setLookupKey(String key){
        LOOKUP_KEY.set(key);
        log.info("切换至数据源-->"+key+"!");
    }
}
